<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MotaSiteStandard.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MotaWeb.Models.Interfaces.ISiteUser>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	MoTA - Users
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Site Users</h2>

    <table>
        <tr>
            <th></th>
            <th>
                User Name
            </th>
            <th>
                Email
            </th>
            <th>
                First Name
            </th>
            <th>
                Last Name
            </th>
            <th>
                Roles
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Edit", "EditUser", new { userName=item.UserName }) %> |
                <%= Html.ActionLink("Details", "Details", new { userName = item.UserName })%>
            </td>
            <td>
                <%= Html.Encode(item.UserName) %>
            </td>
            <td>
                <%= Html.Encode(item.Email) %>
            </td>
            <td>
                <%= Html.Encode(item.FirstName) %>
            </td>
            <td>
                <%= Html.Encode(item.LastName) %>
            </td>
            <td>
                <%= Html.Encode(item.RolesDisplay) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Create New", "Create") %>
    </p>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

